home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group95b.txt / 000106_icon-group-sender _Thu Jul 27 16:00:49 1995.msg < prev    next >
Internet Message Format  |  1995-09-18  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Thu, 27 Jul 1995 16:37:17 MST
  2. Date: Thu, 27 Jul 1995 16:00:49 -0500
  3. From: "Mark B. Emmer" <Mark.Emmer@internetmci.com>
  4. Subject: Re: snobol4 question
  5. To: "Le Baron O. Ferguson" <ferguson@math.ucr.edu>,
  6.         "icon-group@cs.arizona.edu" <icon-group@cs.arizona.edu>
  7. Message-Id: <01HTDH9ZY0368WWAKM@MAILSRV1.PCY.MCI.NET>
  8. X-Mailer: e-mailMCI v2.3
  9. Content-Transfer-Encoding: 7BIT
  10. Errors-To: icon-group-errors@cs.arizona.edu
  11.  
  12. -- [ From: Mark B. Emmer * EMC.Ver #2.3 ] --
  13.  
  14. > From: Le Baron O. Ferguson     \ Internet:    (ferguson@math.ucr.edu)
  15. > To:   icon-group@cs.arizona.edu \ Internet:    (icon-group@cs.arizona.edu)
  16. )
  17. > Subject: snobol4 question
  18. > My problem is that I am using snobol4 to send control codes (among other
  19. > things) to a printer.  I assign to the variable OUTPUT.  The output of
  20. the
  21. > program is directed to the printer by /o=lpt2: on the command line.  The
  22. > problem is that the assignment to OUTPUT causes a newline to also be
  23. sent.  I
  24. > can program around this but it is aukward.  In PASCAL we have WRITELN and
  25. > WRITE, and the latter does not append a newline automatically.  In C,
  26. printf
  27. > simply does not send a newline unless you tell it to do so.  Is there a
  28. > corresponding mechanism in snobol4?
  29.  
  30. If you're using SNOBOL4+, use a channel number on the command line, and the
  31. 'b' (binary) option in an explicit output statement:
  32.  
  33. Command line:
  34. snobol4 progname /3=lpt2:
  35.  
  36. Program statement:
  37.     output('out',3,'b')
  38.  
  39. That suppresses the automatic CR/LF.
  40.  
  41. This won't work if you're using Vanilla SNOBOL4.  The 'b' option was
  42. omitted. However, here's a cheat that will work with either system as long
  43. as you are writing to a character device, like lpt2:
  44.  
  45. The old DOS end-of-file character control-Z will cause DOS to stop sending
  46. any data that follows in the same write operation.  CHAR(26) is control-Z. 
  47. So
  48.  
  49.     OUTPUT = 'abc' CHAR(26)
  50.  
  51. writes the three characters 'abc' to the device, and does not output either
  52. the control-Z or the carriage-return/line-feed that follow.
  53.  
  54. ----------------------------------------------------------------
  55. Mark Emmer
  56. Catspaw, Inc.           Voice:  719-539-3884
  57. P.O. Box 1123           FAX:    719-539-4830
  58. Salida, CO 81201 USA    e-mail: Mark.Emmer@internetMCI.com
  59.  
  60. *******************  NOTE NEW E-MAIL ADDRESS  ************************
  61.  
  62.  
  63.